package promote.brozen.spring.lifecycle;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @author Brozen
 * @date 2020/8/30 10:27 PM
 * @email brozen@qq.com
 */
@Slf4j
@Component
public class JustABean implements InitializingBean {

    private String tag;

    public JustABean() {
        this("tag when no args constructor");
    }

    public JustABean(String tag) {
        this.tag = tag;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("It's just a bean initialized. {}", tag);
    }
}
